require(['jquery', 'cookie', 'app', 'lay', 'base64'], function ($) {
    require(['vue'], function (Vue) {
        var dic = new Vue({
            el: ".vue-box"
            , data: {
                that: []
            }
            , created: function () {
                this.that = playAjax("/SwiperController/MailList").data
            }
            , methods: {

                referXadmin: function () {
                    window.reload();
                },
                deleted: function (uuid) {
                    var re=playAjax("/SwiperController/Deleted",{uuid:uuid});
                    alr(re.msg);
                    this.referXadmin();
                },
                add:function () {
                    var ck = getCode("2");
                    $(".layui-table").append("<tr><td>&nbsp;</td><td ondblclick=\"editDBL(this)\"></td><td ondblclick=\"editDBL(this)\"></td><td><div class=\"layui-btn-group\">\n" +
                        "                        <button class=\"layui-btn layui-btn-radius layui-btn-warm\" onclick=\"Save(this)\" >保存</button>\n" +
                        "                    </div></td></tr>");

                }
            }
        });
    });
});
function editDBL(e) {
    $(e).html("<input class='layui-input' type='text' onblur='editBlur(this)'/>");
}
function Save(e) {
    var uid =e;
    debugger
    var val=$(uid).parent().parent().prev().text();
    var keyst=$(uid).parent().parent().prev().prev().text();
    var uuid=$(uid).parent().parent().prev().prev().prev().text();
    if(val.trim()==""||keyst.trim()==""){
        alr("请填写完成");
        return false;
    }
    debugger;
    var re=playAjax("/SwiperController/SaveMail",{val:val,keyst:keyst,uuid:uuid});
    alr(re.msg);
}